<extend name="Base/common"/>

<block name="style">
    <style type="text/css">
        .nav-pills{
            border-bottom: 1px solid #d3d1e5;
        }
        .nav-pills>li>a{
            border-radius: 0px;
        }
        .nav-pills>li.active>a, 
        .nav-pills>li.active>a:focus, 
        .nav-pills>li.active>a:hover{
            background-color: #fff;
            color: #8084e7;
            border-bottom: 2px solid #8084e7;
        }
    </style>
</block>

<block name="body">
    <div id="page-wrapper" style="padding-left: 20px;padding-right: 20px;">
        <div class="col-md-12 col-sm-12" style="padding-left: 0px;padding-right: 0px;">
                    <div class="panel panel-default">
                        <ul class="nav nav-pills">
                                <li class="active"><a href="#order-status1" data-toggle="tab">退货中</a>
                                </li>
                                <li class=""><a href="#order-status2" data-toggle="tab">已完成</a>
                                </li>
                         </ul>
                        <div class="panel-body">
                             <form role="form" id="search_form">
                                    <div class="form-group col-md-2">
                                        <label for="start_time">创建起始时间</label>
                                        <input type="text" class="form-control" id="start_time" name="start_time" placeholder="选择开始时间">
                                    </div>
                                    <div class="form-group col-md-2">
                                        <label for="end_time">创建结束时间</label>
                                        <input type="email" class="form-control" id="end_time" name="end_time" placeholder="选择结束时间">
                                    </div>
                                    <div class="form-group col-md-2">
                                     <label for="return_sn">退货单号</label>
                                     <input type="text" id="return_sn" name="return_sn" class="form-control">
                                    </div>
                                    <div class="form-group col-md-2"></div>
                                    <div class="form-group col-md-1">
                                        <label for="bid_search" style="opacity: 0;">1</label>
                                        <button type="button" id="bid_search" class="btn btn-default form-control" style="background:#8084e7!important;color: #fff;border: 0;">查询</button>
                                    </div>
                                    <div class="form-group col-md-1">
                                        <label for="refresh" style="opacity: 0">1</label>
                                        <button type="button" id="refresh" class="btn btn-default form-control">重置</button>
                                    </div>
                             </form>
                        </div>

                        <div class="panel-body" style="padding:0px;">

                            <div class="tab-content">

                                <div class="tab-pane fade active in" id="order-status1" data-action="{:U('ajaxPostReturnlist',array('status'=>1))}">
                                       <div class="table-responsive">
                                        <table class="table table-hover" id="dataTables-example" style="border: 1px solid #ddd;margin-bottom: 0px;">
                                          <thead>
                                              <tr class="active w_table_tr1">
                                                  <td style="width: 12%">创建时间</td>
                                                  <td style="width: 13%">退货单号</td>
                                                  <td style="width: 13%">对应订单号</td>
                                                  <td style="width: 15%">待退货数量</td>
                                                  <td style="width: 15%">已退货数量</td>
                                                  <td style="width: 12%">已拒退数量</td>
                                              </tr>
                                          </thead>
                                          <tbody>
                                           <notempty name="order_list1">
                                             <volist name="order_list1" id="vo">
                                               <tr class="odd gradeX">
                                                   <td>{$vo.create_time|time_format='Y-m-d H:i:s'}</td>
                                                   <td>{$vo.return_sn}</td>
                                                   <td><?php echo M('order_list')->where(array('id'=>$vo['order_id']))->getField('order_sn'); ?></td>
                                                   <td>{$vo.return_count}</td>
                                                   <td class="center">{$vo.return_suceess}</td>
                                                   <td class="center">{$vo.return_fail}</td>
                                               </tr>
                                             </volist>  
                                            <else/>
                                              <tr><td colspan="6" class="text-center">暂时还没有竞价信息!</td></tr>
                                            </notempty>                    
                                          </tbody>  
                                     </table>

                                   </div>
                                </div>


                                <div class="tab-pane fade" id="order-status2" data-action="{:U('ajaxPostReturnlist',array('status'=>2))}">
                                    <div class="table-responsive">
                                        <table class="table table-hover" id="dataTables-example-end"  style="border: 1px solid #ddd;margin-bottom: 0px;">
                                          <thead>
                                              <tr class="active w_table_tr1">
                                                  <td style="width: 12%">创建时间</td>
                                                  <td style="width: 13%">退货单号</td>
                                                  <td style="width: 13%">对应订单号</td>
                                                  <td style="width: 15%">已退货数量</td>
                                                  <td style="width: 15%">已退金额</td>
                                                  <td style="width: 12%">已拒退数量</td>
                                              </tr>
                                          </thead>
                                          <tbody>
                                           <notempty name="order_list2">
                                            <volist name="order_list2" id="vo">
                                              <tr class="odd gradeX">
                                                  <td>{$vo.create_time|time_format='Y-m-d H:i:s'}</td>
                                                  <td>{$vo.return_sn}</td>
                                                  <td><?php echo M('order_list')->where(array('id'=>$vo['order_id']))->getField('order_sn'); ?></td>
                                                  <td>{$vo.return_suceess}</td>
                                                  <td class="center">{$vo.return_success_price}</td>
                                                  <td class="center">{$vo.return_fail}</td>
                                              </tr>
                                             </volist>   
                                             <else/>
                                              <tr><td colspan="6" class="text-center"> aOh!  暂时还没有信息! </td>
                                              </tr>
                                            </notempty>                   
                                          </tbody>  
                                     </table>
                            
                                   </div>
                                </div>


                            </div>
                        </div>
                    </div>
                </div>
        <!-- /. PAGE INNER  -->
    </div>
</block>
<block name="script">
<script src="__STATIC__/layui/layui/layui.js"></script>
    <script type="text/javascript">
        layui.use('laydate', function(){
          var laydate = layui.laydate;
  
        //执行一个laydate实例
           laydate.render({
              elem: '#start_time' //指定元素
              ,type: 'datetime'
              ,format: 'yyyy-MM-dd HH:mm:ss' //可任意组合
          });

          laydate.render({
              elem: '#end_time' //指定元素
              ,type: 'datetime'
              ,format: 'yyyy-MM-dd HH:mm:ss' //可任意组合
          }); 
       });

 </script>
</block>